/*
 * Copyright 2011 Kim Lindhardt Madsen
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package dk.lindhardt.gwt.geie.client.edit;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.HTMLTable;
import dk.lindhardt.gwt.geie.client.ElementStyler;
import dk.lindhardt.gwt.geie.client.TableMouseEventHandler;
import dk.lindhardt.gwt.geie.shared.Cell;
import dk.lindhardt.gwt.geie.shared.TableLayout;

/**
 * User: AnAmuser
 * Date: 14-07-11
 * <p/>
 * Implementers of this interface controls editing of the HTML table.
 */
public interface HTMLTablePresenter {

   /**
    * Sets the context where this editor is working
    * @param layout the underlying table layout that is edited
    * @param table the table presented to the user
    * @param styler the styler responsible for styling cell elements
    * @param mouseEventHandler controls mouse events on the table
    */
   void setContext(TableLayout layout, HTMLTable table, ElementStyler styler, TableMouseEventHandler mouseEventHandler);

   /**
    * Called when the user clicks on the table
    * @param row     row index clicked
    * @param column  column index clicked
    */
   void onTableClick(int row, int column);

   /**
    * <b>NOT IMPLEMENTED YET</b>
    * <br/>
    * Called when users select a range of cells
    * @param topLeftRow the top left row of the range
    * @param topLeftColumn  the top left column of the range
    * @param bottomRightRow  the bottom right row of the range
    * @param bottomRightColumn  the bottom right column of the range
    */
   void onTableRangeSelect(int topLeftRow, int topLeftColumn, int bottomRightRow, int bottomRightColumn);
}
